<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:import href="xsl_import/global_popup_headerfooter_imp.xsl" />
	<xsl:variable name="windowtitle">
		<xsl:value-of select="application_header/title" />
	</xsl:variable>
	<xsl:variable name="all" select="//indexLabel/label" />
	<xsl:variable name="alphaIndex" select="'abcdefghijklmnopqrstuvwxyz0123456789'" />
	<xsl:variable name="capsIndex" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'" />
	<xsl:template match="/">
		<html>
			<head>
				<title>
					Site Index 
				</title>
				<link href="styleguide/includes/fds_corporate.css" rel="styleSheet" type="text/css" />
				<script language="javascript">
				function openLink (URL,newWin) {
					if (newWin) {
						window.open(URL);
						window.close();
					} else {
						window.opener.parent.location.href=URL;
						window.close();
					}
				
				}
				</script>
			</head>
			<body bgcolor="white" marginheight="0" marginwidth="0" bottommargin="0" topmargin="0">
				<xsl:call-template name="popupheader"></xsl:call-template>
				<table width="95%" align="center" cellpadding="0" cellspacing="0">
					<tr>
						<xsl:call-template name="printindexnav">
							<xsl:with-param name="next" select="$alphaIndex" />
						</xsl:call-template>
					</tr>
				</table>
				<br clear="all" />
				<table width="95%" align="center">
					<tr>
						<td width="100%" align="left" valign="top">
							<div style="border:solid 1px #000000;padding:4px;width:100%;height:272px;overflow:auto;align:center;">
								<xsl:call-template name="printindex">
									<xsl:with-param name="next" select="$alphaIndex" />
								</xsl:call-template>
							</div>
						</td>
					</tr>
				</table>
				<br clear="all" />
				<xsl:call-template name="popupfooter"></xsl:call-template>
			</body>
		</html>
	</xsl:template>
	<!-- print navigation bar with links to all letters -->
	<xsl:template name="printindexnav">
		<xsl:param name="next" />
		<xsl:variable name="nextletter" select="substring($next,1,1)" />
		<xsl:variable name="capsnextletter" select="translate($nextletter, $alphaIndex, $capsIndex)" />
		<xsl:choose>
			<xsl:when test="$all[ starts-with(., $nextletter) or starts-with(., $capsnextletter)]">
				<td style="border:Black;border-bottom-style:double;border-top-style:double;padding-bottom:3px;padding-top:3px;">
					<a href="#letter_{$nextletter}">
						<xsl:value-of select="$capsnextletter" />
					</a>
				</td>
			</xsl:when>
			<xsl:otherwise>
				<td style="border:Black;border-bottom-style:double;border-top-style:double;padding-bottom:3px;padding-top:3px;">
					<xsl:value-of select="$capsnextletter" />
				</td>
			</xsl:otherwise>
		</xsl:choose>
		<!-- any more? -->
		<xsl:if test="$nextletter != substring($alphaIndex, string-length($alphaIndex))">
			<xsl:call-template name="printindexnav">
				<xsl:with-param name="next" select="substring-after($alphaIndex, $nextletter)" />
			</xsl:call-template>
		</xsl:if>
	</xsl:template>
	<xsl:template name="printindex">
		<xsl:param name="next" />
		<xsl:variable name="nextletter" select="substring($next,1,1)" />
		<xsl:variable name="capsnextletter" select="translate($nextletter, $alphaIndex, $capsIndex)" />
		<xsl:apply-templates select="$all[ starts-with(., $nextletter) or starts-with(., $capsnextletter)]">
			<xsl:with-param name="nextletter" select="$nextletter" />
			<xsl:with-param name="capsnextletter" select="$capsnextletter" />
			<xsl:sort select="." />
		</xsl:apply-templates>
		<!-- any more? -->
		<xsl:if test="$nextletter != substring($alphaIndex, string-length($alphaIndex))">
			<xsl:call-template name="printindex">
				<xsl:with-param name="next" select="substring-after($alphaIndex, $nextletter)" />
			</xsl:call-template>
		</xsl:if>
	</xsl:template>
	<xsl:template match="label">
		<xsl:param name="nextletter" />
		<xsl:param name="capsnextletter" />
		<xsl:if test="position() = 1">
			<a name="#letter_{$nextletter}"></a>
			<h4 id="letter_{$nextletter}">
				<xsl:value-of select="$capsnextletter" />
			</h4>
		</xsl:if>
		<xsl:variable name="thisaction" select="../../action"></xsl:variable>
		<xsl:variable name="thisworkarea" select="../../work_area"></xsl:variable>
		<xsl:variable name="thistarget" select="../../work_area/@target"></xsl:variable>
		<xsl:choose>
			<xsl:when test="$thistarget">
				<a>
					<xsl:attribute name="href">
						<xsl:text disable-output-escaping="yes">javascript:openLink('</xsl:text>
						<xsl:value-of select="$thisworkarea" />
						<xsl:text disable-output-escaping="yes">',true);</xsl:text>
					</xsl:attribute>
					<xsl:value-of select="." />
				</a>
				<br />
			</xsl:when>
			<xsl:otherwise>
				<a>
					<xsl:attribute name="href">
						<xsl:text disable-output-escaping="yes">javascript:openLink('</xsl:text>
						<xsl:value-of select="$thisaction" />
						<xsl:text disable-output-escaping="yes">',false);</xsl:text>
					</xsl:attribute>
					<xsl:value-of select="." />
				</a>
				<br />
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
</xsl:stylesheet>
